<%-- 
    Document   : ConfirmCancelTour
    Created on : Nov 1, 2011, 11:34:42 PM
    Author     : MrKoi
--%>

<%@page import="DAL.TourPackageBean"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ page session="true" import="java.util.Collection"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="f" %>
<!DOCTYPE html>
<%
    String username="";    
    String typeTour="";
    String numberOfChild="";
    String numberOfAdult="";
    String totalOfGuest="";
    String totalTMoney="";
    String startDate="";
    String endDate="";
    String dateBooking="";
    String cash="";
    String adultPrice="";
    String childPrice="";
    String refundMoney="";
    
    if(session.getAttribute("User")!=null) {
        
        username=session.getAttribute("User").toString();
      //  String idbooking=session.getAttribute("").toString();
        String tourId=session.getAttribute("CtourId").toString();
        typeTour=session.getAttribute("CtypeTour").toString();
        numberOfChild=session.getAttribute("CnumberOfChild").toString();
        numberOfAdult=session.getAttribute("CnumberOfAdult").toString();
        totalOfGuest=session.getAttribute("CtotalOfGuest").toString();
        startDate=session.getAttribute("Cstartdate").toString();
        endDate=session.getAttribute("CendDate").toString();
        dateBooking=session.getAttribute("CdateBooking").toString();
        totalTMoney=session.getAttribute("Ctotalmoney").toString();
        
        cash=session.getAttribute("Ccash").toString();
        refundMoney=session.getAttribute("crefundMoney").toString();
        
        TourPackageBean tBill=new TourPackageBean();
        Collection coll=tBill.getPricetourPackage(tourId);
        request.setAttribute("CanBillTour",coll);
        
    } else {
        out.println("<script>alert('Please login before view bills of the tour !');window.location='index.jsp';</script>");
        
    }
    %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
         <center>
                <span style="font-size: 20px;color: #343434;">Details of Booking Tour</span>
  
          <form action="ControllerCancelTour" method="post">
              
              <table border="0" width="490" style="background-color: #f7f6f6">
                  
                  <tr>
                    <td colspan="2" align="left"><h3>Information of the tour: </h3></td>
                </tr>
                 <tr>
                    <td align="left" width="150px">Tour name:</td>
                    <td align="left" style="font-size:12px;font-family:Arial, Helvetica, sans-serif;"><b><%=typeTour%><b/></td>
                </tr>
                 <c:forEach items="${CanBillTour}" var="tpc">
                    <tr>
                        <td align="left">Adult price:</td>
                        <td align="left"><b><f:formatNumber value="${tpc.adultPrice}" pattern="$#,###" />/1 person</b></td>
                    </tr>
                    <tr>
                        <td align="left">Child price:</td>
                        <td align="left"><b><f:formatNumber value="${tpc.childPrice}" pattern="$#,###" />/1 person</b></td>
                    </tr>
                </c:forEach>
                    <tr>
                    <td colspan="2" align="left"><h3>Details of the registration: </h3></td>
                </tr>
                <tr>
                    <td align="left">User name:</td>
                    <td align="left"><%=username%></td>
                </tr>
                <tr>
                    <td align="left">Start date of traveling:</td>
                    <td align="left"><%=startDate%></td>
                </tr>
                <tr>
                    <td align="left">End date of traveling :</td>
                    <td align="left"><%=endDate%></td>
                </tr>
                <tr>
                    <td align="left">Date booking :</td>
                    <td align="left"><%=dateBooking%></td>
                </tr>
                <tr>
                    <td align="left">Number of children traveling:</td>
                    <td align="left"><%=numberOfChild%> person</td>
                </tr>
                <tr>
                    <td align="left">Number of adults traveling:</td>
                    <td align="left"><%=numberOfAdult%> person</td>
                </tr>
                <tr>
                    <td align="left">Total of guest :</td>
                    <td align="left"><%=totalOfGuest%> person</td>
                </tr>        
                <tr>
                    <td align="left">Sum money :</td>
                    <td align="left"><f:formatNumber value="<%=totalTMoney%>" pattern="$#,###" /></td>
                </tr>
                <tr>
                    <td align="left">Method payment:</td>
                    <td align="left"><%=cash%></td>
                </tr>
                 <tr>
                    <td colspan="2" align="left"><h3>Information of canceling the tour:</h3></td>           
                </tr>
               
                <tr>
                    <td align="left">Refund money:</td>        
                    <td align="left"><f:formatNumber value="<%=refundMoney%>" pattern="$#,###" /></td>            
                </tr>
                <tr> 
                    <td align="center" colspan="2"><input type="submit" value="Confirm cancel" name="cofirmCan" style="background-image:url(skinImgTuor/btnSmall.jpg);color:black;"/></td>                    
                </tr>
                <tr>
                    <td align="left" style="color: #CC3333;"><b>Note :<b/></td>        
                    <td align="left" style="color: #CC3333;">
                        <i>
                                The refund rules are given as below:
                                <br>
                                Before 1 day – 75%
                                <br>
                                2 days – 80%
                                <br>
                                3 days – 85%
                                <br>
                                4 days – 90%
                                <br>
                                5 days or more – 95%
                            </i>
                    </td>            
                </tr>
                
              </table>
              
              
              
              
              
              
              
              
              
           
            </form>
        </center>     
               
   
    
    </body>
</html>